import 'package:flutter/material.dart';
import 'package:flutterapp/chapter/six/scroll_6_3_1_fixed_grid_view.dart';
import 'package:flutterapp/chapter/six/scroll_6_3_2_count_grid_view.dart';
import 'package:flutterapp/chapter/six/scroll_6_3_3_max_grid_view.dart';
import 'package:flutterapp/chapter/six/scroll_6_3_4_extent_grid_view.dart';
import 'package:flutterapp/chapter/six/scroll_6_3_5_builder_grid_view.dart';
import 'package:flutterapp/utils/navigator_utils.dart';

/// @date 2020/07/21  16:16
/// @author 程志强
/// @des grid view

class GridViewRoute extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("GridView"),
      ),
      body: Container(
        margin: EdgeInsets.only(left: 20.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            RaisedButton(
                child: Text("SliverGridDelegateWithFixedCrossAxisCount"),
                onPressed: () =>
                    NavigatorUtil.goPageByPush(context, FixedGridViewRoute())),
            RaisedButton(
                child: Text("GridView.count"),
                onPressed: () =>
                    NavigatorUtil.goPageByPush(context, CountGridViewRoute())),
            RaisedButton(
                child: Text("SliverGridDelegateWithMaxCrossAxisExtent"),
                onPressed: () =>
                    NavigatorUtil.goPageByPush(context, MaxGridViewRoute())),
            RaisedButton(
                child: Text("GridView.extent"),
                onPressed: () =>
                    NavigatorUtil.goPageByPush(context, ExtentGridViewRoute())),
            RaisedButton(
                child: Text("GridView.builder"),
                onPressed: () => NavigatorUtil.goPageByPush(
                    context, BuilderGridViewRoute())),
          ],
        ),
      ),
    );
  }
}
